﻿

goog.provide('ol.dmp.interactionGeometry.featureFactory');
goog.provide('ol.dmp.interactionGeometry.FeatureType');

goog.require('ol.dmp.interactionGeometry.Base');
goog.require('ol.dmp.interactionGeometry.Point');
goog.require('ol.dmp.interactionGeometry.LineString');
goog.require('ol.dmp.interactionGeometry.Polygon');
goog.require('ol.dmp.interactionGeometry.SimplyArrow');
goog.require('ol.dmp.interactionGeometry.DiceArrow');
goog.require('ol.dmp.interactionGeometry.AttackArrow');
goog.require('ol.dmp.interactionGeometry.RallyRegion');
goog.require('ol.dmp.interactionGeometry.MultiArrow');

ol.dmp.interactionGeometry.featureFactory = function (type)
{

    var baseFeature;

    switch (type)
    {
        case ol.dmp.interactionGeometry.FeatureType.POINT:
            baseFeature = new ol.dmp.interactionGeometry.Point();
            break;
        case ol.dmp.interactionGeometry.FeatureType.LINESTRING:
            baseFeature = new ol.dmp.interactionGeometry.LineString();
            break;
        case ol.dmp.interactionGeometry.FeatureType.POLYGON:
            baseFeature = new ol.dmp.interactionGeometry.Polygon();
            break;
        case ol.dmp.interactionGeometry.FeatureType.SIMPLYARROW:
            baseFeature = new ol.dmp.interactionGeometry.SimplyArrow();
            break;
        case ol.dmp.interactionGeometry.FeatureType.DICEARROW:
            baseFeature = new ol.dmp.interactionGeometry.DiceArrow();
            break;
        case ol.dmp.interactionGeometry.FeatureType.ATTACKARROW:
            baseFeature = new ol.dmp.interactionGeometry.AttackArrow();
            break;
        case ol.dmp.interactionGeometry.FeatureType.RALLYREGION:
            baseFeature = new ol.dmp.interactionGeometry.RallyRegion();
            break;
        case ol.dmp.interactionGeometry.FeatureType.MULTIARROW:
            baseFeature = new ol.dmp.interactionGeometry.MultiArrow();
            break;
        default:
            baseFeature = null;
            break;
    }

    return baseFeature;
}

ol.dmp.interactionGeometry.FeatureType = {

    POINT:'point',
    LINESTRING: 'linestring',
    POLYGON: 'polygon',
    SIMPLYARROW: 'simplyarrow',
    DICEARROW: 'dicearrow',
    ATTACKARROW: 'attackarrow',
    RALLYREGION: 'rallyregion',
    MULTIARROW:'multiarrow'
};